home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / MATHS / RLAB / RLAB125.ZIP / !RLaB / help_jr / MATLAB_DIF < prev    next >
Text File  |  1994-10-10  |  4KB  |  124 lines

  1. MATLAB-DIFF:
  2.  
  3.     This file tries to discuss most of the ways in which RLaB is
  4.     significantly different from MATLAB. There are a LOT of
  5.     differences; the ones listed herein are the major syntactical,
  6.     and conceptual differences.
  7.  
  8.     1.) The most significant difference between MATLAB and RLaB is
  9.     the fact the RLaB is copyrighted using the GNU Copyleft. This
  10.     gives you the user, access to the source code.
  11.  
  12.     2.) The next most significant difference is RLaB's lack of
  13.     context sensitive syntax and operational rules. MATLAB is a
  14.     very powerful mathematical tool, hopefully RLaB will be as
  15.     capable, but with a simpler, more consistent grammar.
  16.  
  17.     3.) RLaB has distinct data types. NUMBERS, STRINGS, FUNCTIONS,
  18.     and LISTs have different internal representations, and are
  19.     referred to differently by users. 
  20.  
  21.     4.) Matrices are indexed with square braces [ ], not ( ). For
  22.     example:
  23.  
  24.     in MATLAB:
  25.  
  26.         %  Create a matrix
  27.         m = [1, 2, 3; 4, 5, 6; 7, 8, 9];
  28.         %  Add the diagonal elements
  29.         d = m(1,1) + m(2,2) + m(3,3)
  30.  
  31.     in RLaB:
  32.  
  33.         // Create a matrix
  34.         m = [1, 2, 3; 4, 5, 6;, 7, 8, 9];
  35.         // Add the diagonal elements
  36.         d = m[1;1] + m[2;2] + m3;3]
  37.  
  38.     This example highlights two other differences. a.) comments a
  39.     denoted with `//'. Any text following `//' on a line will be
  40.     ignored. b.) the semi-colon, `;' is used as the row - column
  41.     separator.
  42.  
  43.     5.) Strings are denoted with the double quote `"' symbol:
  44.  
  45.         string = "this is a sample string"
  46.  
  47.     The `"' is the ONLY delimiter used for strings.
  48.  
  49.     5a.) String matrices in RLaB are composed of a matrix of
  50.     string literals. Therefore, the elements of a string matrix
  51.     can have different lengths. Note that a matrix, or array of
  52.     strings is not merely a reformatted numeric matrix.
  53.  
  54.     6.) Logical and relational statements: RLaB logical and
  55.     relational statements use a more C-like syntax. See the help
  56.     file `RELATIONAL'.
  57.  
  58.     6.a) Comparison of complex numbers is performed using the
  59.     absolute value, or magnitude for < > <= >=, not the real part
  60.     only. 
  61.  
  62.     7.) Flow control: Again RLaB uses a more C-like syntax for
  63.     flow-control statements. See the help files `IF', `WHILE',
  64.     `FOR' for more elaboration.
  65.  
  66.     8.) User-function syntax and lack of automatic m-file loading.
  67.     RLaB allows users to type in functions interactively, and put
  68.     more than one function in an rfile, Also a mixture of global
  69.     commands and functions can be mixed in a file.  User-functions
  70.     can appear anywhere in an r-file, that is, an r-file can
  71.     consist of a complete program with self-contained functions.
  72.     RLaB DOES NOT automatically load files that end with a `.r'.
  73.     To load existing functions/programs the user must explicitly
  74.     ask RLaB to load the file by typing `load( "file-name" )', or
  75.     by typing `rfile name'.
  76.  
  77.     9.) RLaB plotting functions are supported by Plplot.
  78.  
  79.     10.) RLaB's Vector creation goes like:
  80.     
  81.     start : end : increment
  82.  
  83.     as opposed to MATLAB's 
  84.  
  85.     start : increment : end.
  86.  
  87.     11.) RLaB has an imaginary constant, allowing expressions
  88.     like:
  89.  
  90.     a = 1 + 2i
  91.  
  92.     Note: MATLAB v4.0 has this feature also
  93.  
  94.     12.) RLaB does not automatically keep the value of the last
  95.     statement in the variable called `ans'
  96.  
  97.     13.) The eye( A ) ambiguity (when A is a 1x1 matrix) does not
  98.     exist. I believe MATLAB v4.0 has also resolved this.
  99.  
  100.     14.) The 2./A ambiguity does not exist either. `3./A' is the
  101.     same as `3 ./ A'. The `.' goes with the `/' operator to form
  102.     an element-by-element operator. Again, I believe MATLAB v4.0
  103.     has also resolved this.
  104.  
  105.     15.) RLaB's scoping rules are somewhat different from
  106.     MATLAB's. By default all variables in the RLaB workspace,
  107.     files, and user-functions are global. In functions, variables
  108.     can be declared local or global (but default to local), and in
  109.     files variables can be declared static. 
  110.  
  111.     16.) In general, an attempt was made to follow MATLAB's spirit
  112.     with the builtin functions. However, I have made improvements
  113.     or deviations were it seemed appropriate. As the RLaB language
  114.     was meant to be an evolutionary improvement over the existing
  115.     MATLAB language, so are the linear-algebra functions, which
  116.     use LAPACK, meant to be an inprovement over LINPACK and
  117.     EISPACK.
  118.  
  119.     17.) Left and right division in RLaB return the mininum-norm
  120.     solution for an underdetermined set of equations. MATLAB does
  121.     something different. MATLAB returns the solution, which has at
  122.     most k (the effective rank of the coefficient matrix) nonzero
  123.     components per column.
  124.